From 4bb4a98493a139dfb22bd6a87b1f0ca18140399a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Mon, 15 Jul 2019 05:38:25 +0200 Subject: [PATCH] text: Move some locals into the closest scope --- gtk/gtktext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 0b7aa656ae..127e7d3568 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -4382,15 +4382,12 @@ gtk_text_draw_cursor (GtkText *self, PangoLayout *layout; const char *text; int x, y; - int width, height; context = gtk_widget_get_style_context (widget); layout = gtk_text_ensure_layout (self, TRUE); text = pango_layout_get_text (layout); gtk_text_get_layout_offsets (self, &x, &y); - width = gtk_widget_get_width (widget); - height = gtk_widget_get_height (widget); if (type == CURSOR_DND) cursor_index = g_utf8_offset_to_pointer (text, priv->dnd_position) - text; @@ -4410,6 +4407,8 @@ gtk_text_draw_cursor (GtkText *self, } else /* overwrite_mode */ { + int width = gtk_widget_get_width (widget); + int height = gtk_widget_get_height (widget); graphene_rect_t bounds; bounds.origin.x = PANGO_PIXELS (cursor_rect.x) + x; -- 2.30.2